import Vue from "vue";
import VueRouter from "vue-router"
import discover from "@/pages/discover"
import friend from "@/pages/friend"

// 将VueRounter 注入到所有的Vue子组件
Vue.use(VueRouter)
// 路由配置routes
let routes = [
    {
        path: "/discover",
        component: discover,
        children:[
            {
                path:"play",
                component:()=>import("@/pages/discover/play")
            },
            {
                path:"djradio",
                component:()=>import("@/pages/discover/djradio")
            },
        ]
    },
    {
        path: "/discover",
        component:()=>import("@/pages/page404") 
    },
    {
        path: "/friend/00",
        component: friend
    },
    {
        path: "/mine",
        component: () => import("@/pages/mine")
    },
    {
        path: "/list",
        component: () => import("@/pages/list")
    },
    {
        path: "/detail/:productid",
        // props:true,
        component: () => import("@/pages/detail")
    },
    {path:"*",
       component:()=>import("@/pages/page404")

    }

]
// 实例化路由
let router = new VueRouter({
    routes
})
export default router
